package short_semester.questionnaire_planet.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import short_semester.questionnaire_planet.pojo.QuestionSequenceRecord;
import short_semester.questionnaire_planet.pojo.QuestionnaireRecord;

import javax.transaction.Transactional;
import java.util.List;

public interface QuestionSequenceRecordDao extends JpaRepository<QuestionSequenceRecord,Integer> {
    List<QuestionSequenceRecord> findByQuestionnaireRecord(QuestionnaireRecord record);

    List<QuestionSequenceRecord> findByQuestionnaireRecordOrderBySequence(QuestionnaireRecord record);
    
    @Transactional
    @Modifying
    void deleteByQuestionnaireRecord(QuestionnaireRecord questionnaireRecord);

}
